using System;
using System.Collections;

namespace GenerationCode.Utils
{
	/// <summary>
	/// Summary description for Column.
	/// </summary>
	public class Column
	{
		#region fields
		private string name;		
		private string sqlType;
		private string length;				
		private bool isIdentity;
        private bool isPK;
		#endregion
		
		#region constructor
		public Column ( string name, string sqlType, string length, bool isIdentity,bool isPK ) {
			this.name = name;
			this.sqlType = sqlType;
			this.length = length;	
			this.isIdentity = isIdentity;
            this.isPK = isPK;
		}	
    public Column ( ) {
      this.name = string.Empty;
      this.sqlType = string.Empty;
      this.length = string.Empty;	
      this.isIdentity = false;
      this.isPK = false;
    }	
		#endregion

		#region properties
		public string Name{
			get{ return Utils.Utility.ConvertToFieldName( this.name ); }			
      set{ this.name = value;}
		}
		public string SqlType{
			get{ return this.sqlType;}			
      set{ this.sqlType = value;}
		}
		public string Length{
			get{ return this.length;}	
		  set{ this.length = value;}
		}		
		public string DataType {
			get { return Utils.Utility.ConvertType ( this.sqlType ); }      
		}
		public bool IsIdentity 
		{
			get { return this.isIdentity; }			
      set{ this.isIdentity = value;}
		}
        public bool IsPK
        {
            get { return this.isPK; }
            set { this.isPK = value; }
        }
        public bool IsUnicodeFont
        {
            get 
            {
                if (this.sqlType == "ntext" || this.sqlType == "nvarchar" || this.sqlType == "nchar")
                    return true;
                return false;
            }
        }

		#endregion
	}
}
